<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>文件系统概念和Ext2文件系统 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="本篇为小王同学的第4篇操作系统知识：Linux的Ext2文件系统">
<meta property="og:type" content="article">
<meta property="og:title" content="文件系统概念和Ext2文件系统">
<meta property="og:url" content="https://chudod.gitee.io/myworks/2022/05/18/OS_FileSystem/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="本篇为小王同学的第4篇操作系统知识：Linux的Ext2文件系统">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB5c6be0c67c8d7e412bb46a0fc7dfc4b2?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB59ac0acfacd302c44a1c25b94075ea37?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB3edb3a5062775e84e27a1b3baf7214d4?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB8ccdb56ae2d2ddd63d7a13a576d23bb1?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB8773c112d52de95d6691bdec4e7ea012?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEBb353acd38c3d124728dfb939d9eb1472?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="og:image" content="https://note.youdao.com/yws/api/personal/file/WEB4f0be2bb01668eba716ad737927f1217?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
<meta property="article:published_time" content="2022-05-17T16:00:00.000Z">
<meta property="article:modified_time" content="2022-05-21T03:38:42.804Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="操作系统">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929">
  
    <link rel="alternate" href="/myworks/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/myworks/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/myworks/css/style.css">

  
    
<link rel="stylesheet" href="/myworks/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 6.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/myworks/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/myworks/">Home</a>
        
          <a class="main-nav-link" href="/myworks/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/myworks/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://chudod.gitee.io/myworks"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-OS_FileSystem" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/myworks/2022/05/18/OS_FileSystem/" class="article-date">
  <time class="dt-published" datetime="2022-05-17T16:00:00.000Z" itemprop="datePublished">2022-05-18</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/myworks/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/">计算机基础知识</a>►<a class="article-category-link" href="/myworks/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      文件系统概念和Ext2文件系统
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h1 id="文件系统概念"><a href="#文件系统概念" class="headerlink" title="文件系统概念"></a>文件系统概念</h1><p>我在本科第一次学习“文件系统”时，觉得这一章的很多概念仿佛如空中楼阁，因为“文件系统”太抽象了，后来才慢慢加深理解，其实文件系统就是磁盘管理，也可以说文件系统是物理设备的高级抽象。硬盘（低速设备）读写单位是扇区，通常为512 Bytes，而文件系统的读写单位是块（若干个扇区组成，为了避免频繁访问磁盘，一次读入多个块）。为了管理这些块，需要各种数据结构。</p>
<h2 id="inode和文件控制块FCB"><a href="#inode和文件控制块FCB" class="headerlink" title="inode和文件控制块FCB"></a>inode和文件控制块FCB</h2><p>一个文件被拆分成多个块来存储，因此需要一种文件组织方式。以Windows的FAT32为例，FAT是文件分配表(File Allocation Table)，所有的块被用链式结构来组织，在每一块的最后记录下一块的地址，这样文件不需要连续存储，节省了磁盘空间。FAT文件系统为每个文件都分配了一个FAT表，用单独的链式结构来存储、跟踪文件的所有块。FAT文件系统的缺点是文件查找效率地下，为了定位到最后一个数据块，需要遍历前面的所有数据块，且每访问一个块就涉及一次磁盘寻道，使得本就低速的磁盘访问更加频繁，也许微软受不了FAT32文件系统，后来推出了NTFS文件系统(下图来自《操作系统概念》)。</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB200ceca287a455a1754af8fc6e802128?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="40%" height="40%"/>  

<p>Unix的文件系统比较先进，采用索引结构来组织文件块，文件块依然可以零散地分布在磁盘中，但Unix文件系统为每个文件的所有块都建立了一个索引表，索引表就是块地址数组，数组元素就是块的地址，访问任意一个块只需要从索引表获得块地址就可以了，速度大大提升。包含此索引表的索引结构就是index node，简称inode(i节点)。任何一个文件都有一个inode，inode记录了文件的所有信息，包括一个索引表，记录文件所有块的块地址。索引结构的缺点是索引结构本身要占一定的存储空间，文件越大，块越多，索引表越大，因此Unix采取了一个折中的方法，采用多级索引结构：inode的索引表一共15个索引项，如果文件块小于12块，那么将这12块的块地址直接存储在前12个索引项中，这前面12个索引可以直接获得块地址，如果文件大于12块，就用第13个索引（一级索引指针）指向一个新的块，新的一块存储256个块地址（一个块1024字节，一个块地址4字节，所以可以存储256个块地址），因此一级索引结构可以存储12+256&#x3D;268个块。如果文件大于268个块，就建立二级索引指针，因此inode索引表的第14个索引是二级索引指针，，第15个是三级索引指针，这样可以管理非常大的文件（文件最多$12+256+256\times{256}+256\times{256}\times{256}块\approx{16.06G}$，如果一个块1024个字节）。</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB5c6be0c67c8d7e412bb46a0fc7dfc4b2?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="50%" height="50%"/>  

<p>只要用于控制和管理文件相关信息的数据结构都叫文件控制块FCB(File Control Block)，因此inode也是FCB的一种。并且inode的数量等于文件数量，为了方便管理，分区中所有文件的inode都用一个大表格(inode_table)来维护，用单独的几个磁盘块来存储这个表格，再结合inode位图（单独的一块）。表格就是一个数组，数组中的元素就是inode地址，数组的下标就是inode的编号。可以根据inode编号来查询inode地址。Linux中的inode的定义如下（少了3个字段，但是不重要，没贴出来，来自《深入理解Linx内核》）：</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB59ac0acfacd302c44a1c25b94075ea37?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>  

<h2 id="目录项与目录"><a href="#目录项与目录" class="headerlink" title="目录项与目录"></a>目录项与目录</h2><p>在Unix的inode中，缺少了一个对用户来说至关重要的属性：文件名。用户给出文件名来访问文件，而文件系统通过inode来定位数据块（文件名对文件系统来说不重要，有了inode即可）。因此目录的作用就是将文件名和inode绑定。用户给出文件名，文件在目录项中找到文件名对应的inode，然后再找到数据块。<br>在Linux中，目录和文件都用inode来表示，因此目录也是一种文件。inode同时指向目录和普通文件，磁盘文件系统中没有一种叫做目录的数据结构，磁盘上有的只是inode，inode指向文件实体的数据块，而不关心数据块具体的内容，因此目录和普通文件本质的区别就是“数据块上记录的内容”不同。例如，一个.txt文本文件的数据块记录的是文本文件的ASCII码，而一个目录文件的数据块，记录的内容是目录下包含的所有目录项，如下所示：</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB3edb3a5062775e84e27a1b3baf7214d4?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>  

<p>其中’.’表示当前目录，’..’表示上一级目录，每一个目录项的字段如下所示：</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB8ccdb56ae2d2ddd63d7a13a576d23bb1?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/> 

<p>目录项长度通常为4的倍数，不足4的倍数会在文件名末尾补上’\0’。可以看到，目录项包含文件对应的inode索引，因此获得这个索引之后，就可以根据该索引值计算出inode地址，然后就可以得到文件的inode了。这一个inode指向的文件也可能是目录文件，因此数据块中包含目录项，这样就可以根据多级目录来查询了。另外，不管是普通文件还是目录文件（这里将目录称之为“目录文件”），总会位于一个目录下，所有普通文件和目录都位于根目录’&#x2F;‘下，根目录是所有目录的父目录。<br>我本科学到这里的时候被绕晕了：要想找到数据块，必须找到文件的inode，而要找到文件的inode，又必须要知道目录项（目录项包含inode索引），而要找到目录项又必须先找到数据块（目录项本身又是目录文件数据块里面的内容）……寻找过程似乎是个死循环。这种看似死循环的过程，原因无外乎就是上层目录是无休止的，因此有个固定的目录就可以了，答案就是根目录’&#x2F;‘！每个分区都有自己的根目录，根目录是所有目录的父目录，在创建文件分区的时候就已经在一个固定死的位置写好了根目录的inode，查找文件时时都首先根据根目录inode获得根目录数据块，然后再查找这个数据块里面的目录项，最后递归查找，找到任意子目录的文件。因此查找&#x2F;home&#x2F;hello.txt文件的过程是：</p>
<ul>
<li>1、文件系统找到根目录’&#x2F;‘的inode</li>
<li>2、由根目录的inode找到根目录的数据块</li>
<li>3、根目录数据块中有home目录项，并由home目录项找到home这个目录文件的inode</li>
<li>5、由home目录文件的inode找到home目录的数据块</li>
<li>6、home目录数据块有hello.txt目录项，并由该目录项找到hollo.txt这个文件的inode</li>
<li>7、由hello.txt文件的inode找到对应的数据块，数据块存储着字符串的ASCII码值。</li>
</ul>
<h2 id="文件系统布局"><a href="#文件系统布局" class="headerlink" title="文件系统布局"></a>文件系统布局</h2><p>Ext2文件系统在磁盘上的布局如下图所示：<br><img src="https://note.youdao.com/yws/api/personal/file/WEB8773c112d52de95d6691bdec4e7ea012?method=download&shareKey=69113f8f61e335d1864757cf6d288929"><br>Ext2文件系统将若干个块分成一个组，一个分区可能有多个块组。</p>
<ul>
<li><p>在整个磁盘中，最开始一个块是引导块，包含引导操作系统的相关信息，MBR(Master Boot Record和Loader程序就在这个块中)。如果该磁盘不包含操作系统，则该块内容为空。NTFS文件系统称该之为分区引导扇区。</p>
</li>
<li><p>每个块组的第一块是超级块，是在为分区创建文件系统时创建的，超级块包含总的inode数量、块的数量、每块的大小（字节）、每组的块数等等这些重要信息，详细字段如下所示：</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEBb353acd38c3d124728dfb939d9eb1472?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/> 
</li>
<li><p>组描述符紧跟着超级块，记录着数据块位图从几号块开始、inode位图从几号块开始、inode节点从几号块开始等等信息，具体字段如下：</p>
<div style = "align: center">
<img src="https://note.youdao.com/yws/api/personal/file/WEB4f0be2bb01668eba716ad737927f1217?method=download&shareKey=69113f8f61e335d1864757cf6d288929" width="70%" height="70%"/>
</li>
<li><p>之后是数据块位图和inode位图，记录那些块被（数据块或者inode）使用过了，1比特表示对应的块被使用过了。</p>
</li>
<li><p>索引节点块存储所有inode。</p>
</li>
<li><p>后面的所有块均为存储数据的数据块（存储目录文件、普通文件）</p>
</li>
</ul>
<h2 id="Ext2文件系统实例"><a href="#Ext2文件系统实例" class="headerlink" title="Ext2文件系统实例"></a>Ext2文件系统实例</h2><p>现有一个磁盘had.raw，根目录的内容如下，一共4个文件（包括目录）：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">.</span><br><span class="line">..</span><br><span class="line">lost+found</span><br><span class="line">hello.txt</span><br></pre></td></tr></table></figure>
<p>利用hexdump命令查看磁盘内容：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexdump -C rootfs/hda.raw | less</span><br></pre></td></tr></table></figure>
<p>磁盘内容如下，可以根据各个块的字段来查看意义：</p>
<h3 id="超级块"><a href="#超级块" class="headerlink" title="超级块"></a>超级块</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">00000000</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以上为引导块（0号块），接下来为超级块（1号块）</span></span><br><span class="line"><span class="number">00000400</span>  <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">08</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">66</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> cd <span class="number">07</span> <span class="number">00</span> <span class="number">00</span>  |........f.......|</span><br><span class="line">          ^_________^ ^_________^</span><br><span class="line">        s_inodes_count s_blocks_count</span><br><span class="line"><span class="number">00000410</span>  f4 <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                   s_log_block_size</span><br><span class="line"><span class="number">00000420</span>  <span class="number">00</span> <span class="number">20</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">20</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">43</span> <span class="number">54</span> <span class="number">9</span>e <span class="number">5</span>e  |. ... ......CT.^|</span><br><span class="line">          ^_________^              ^_________^</span><br><span class="line">          s_blocks_per_group       s_inodes_per_group</span><br><span class="line"><span class="number">00000430</span>  c8 <span class="number">56</span> <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">15</span> <span class="number">00</span>  <span class="number">53</span> ef <span class="number">01</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |.V.^....S.......|</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">s_inodes_count</td>
<td align="center">0x0100</td>
<td align="center">总共包含0x0100个inode</td>
</tr>
<tr>
<td align="center">s_blocks_count</td>
<td align="center">0x0800</td>
<td align="center">总共包含0x0800块</td>
</tr>
<tr>
<td align="center">s_log_block_size</td>
<td align="center">0x0000</td>
<td align="center">块大小为$1024\times{2^0}$，即1024B</td>
</tr>
<tr>
<td align="center">s_blocks_per_group</td>
<td align="center">0x2000</td>
<td align="center">每组包含0x2000块</td>
</tr>
<tr>
<td align="center">s_inodes_per_group</td>
<td align="center">0x0100</td>
<td align="center">每组包含0x0100(256)个inode，占$\frac{256}{8}&#x3D;32$个块</td>
</tr>
</tbody></table>
<p>其中每个inode占128字节，因此一个块包含$\frac{1024}{128}&#x3D;8$个inode。</p>
<h3 id="组描述符"><a href="#组描述符" class="headerlink" title="组描述符"></a>组描述符</h3><p>组描述符紧跟着超级块</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为组描述符（2号块）</span></span><br><span class="line"><span class="number">00000800</span>  <span class="number">03</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">05</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> cd <span class="number">07</span> f4 <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^_________^  ^_________^</span><br><span class="line">     bg_clock_bitmap bg_inode_bitmap bg_inode_table</span><br><span class="line"><span class="number">00000810</span>  <span class="number">02</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00000820</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">bg_clock_bitmap</td>
<td align="center">0x03</td>
<td align="center">数据块位图区从3号块开始</td>
</tr>
<tr>
<td align="center">bg_inode_bitmap</td>
<td align="center">0x04</td>
<td align="center">inode位图区从4号块开始</td>
</tr>
<tr>
<td align="center">bg_inode_table</td>
<td align="center">0x05</td>
<td align="center">inode区从5号块开始</td>
</tr>
</tbody></table>
<h3 id="数据区位图和inode位图-bitmap"><a href="#数据区位图和inode位图-bitmap" class="headerlink" title="数据区位图和inode位图(bitmap)"></a>数据区位图和inode位图(bitmap)</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为数据块位图区（3号块）</span></span><br><span class="line"><span class="number">00000</span>c00  ff ff ff ff ff ff <span class="number">01</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00000</span>c10  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以下为i节点位图区（4号块）</span></span><br><span class="line"><span class="number">00001000</span>  ff <span class="number">0f</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00001010</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00001020</span>  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<h3 id="inode区"><a href="#inode区" class="headerlink" title="inode区"></a>inode区</h3><p>inode区从5号块开始，因此起始地址应该是0x400$\times{5}&#x3D;$0x1400，查看此处数据。另外根目录的inode是定死的，位于inode区的第2个，地址就是0x1400+128$\times$2&#x3D;0x1480（inode区的第一个inode没有意义）：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为inode区（5号块）</span></span><br><span class="line"><span class="number">00001400</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="comment">//以下为2号i节点（i节点从1开始编号），即根目录的i节点</span></span><br><span class="line"><span class="number">00001480</span>  ed <span class="number">41</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">49</span> <span class="number">4</span>d <span class="number">9</span>e <span class="number">5</span>e <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e  |.A......IM.^FJ.^|</span><br><span class="line">                      ^_________^</span><br><span class="line">                      <span class="built_in">i_size</span>(bytes)</span><br><span class="line"><span class="number">00001490</span>  <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">03</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |FJ.^............|</span><br><span class="line">                                               ^_________^</span><br><span class="line">                                                i_blocks</span><br><span class="line"><span class="number">000014</span>a0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">25</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |........%.......|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                    i_block</span><br><span class="line"><span class="number">000014b</span>0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">字段</th>
<th align="center">值</th>
<th align="center">意义</th>
</tr>
</thead>
<tbody><tr>
<td align="center">i_size</td>
<td align="center">0x0400</td>
<td align="center">文件大小0x400B&#x3D;1KB</td>
</tr>
<tr>
<td align="center">i_blocks</td>
<td align="center">0x0002</td>
<td align="center">文件数据块数为2</td>
</tr>
<tr>
<td align="center">i_block</td>
<td align="center">0x0025</td>
<td align="center">第一个数据块的块号为37，偏移是0x400$\times$37&#x3D;0x9400</td>
</tr>
</tbody></table>
<h3 id="根目录数据块"><a href="#根目录数据块" class="headerlink" title="根目录数据块"></a>根目录数据块</h3><p>在地址0x9400处查看根目录数据块中的内容，其中记录着目录项：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为根目录的第一个数据块</span></span><br><span class="line"><span class="number">00009400</span>  <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">01</span> <span class="number">02</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^___^ ^^ ^^  ^_________^ ^_________^</span><br><span class="line">          inode       rec_len      name         inode</span><br><span class="line">                            ^name_len </span><br><span class="line">                               ^file_type      ^第<span class="number">2</span>个目录项</span><br><span class="line"><span class="number">00009410</span>  <span class="number">0</span>c <span class="number">00</span> <span class="number">02</span> <span class="number">02</span> <span class="number">2</span>e <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span>  <span class="number">0b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">14</span> <span class="number">00</span> <span class="number">0</span>a <span class="number">02</span>  |................|</span><br><span class="line">          ^___^ ^^ ^^ ^_________^  ^_________^ ^___^ ^^ ^^</span><br><span class="line">                                   ^第<span class="number">3</span>个目录项</span><br><span class="line"><span class="number">00009420</span>  <span class="number">6</span>c <span class="number">6f</span> <span class="number">73</span> <span class="number">74</span> <span class="number">2b</span> <span class="number">66</span> <span class="number">6f</span> <span class="number">75</span>  <span class="number">6</span>e <span class="number">64</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |lost+found......|</span><br><span class="line">          ^__________________________________^ ^_________^</span><br><span class="line">          ^文件名lost+found，末尾用\<span class="number">0</span>补充        ^第<span class="number">4</span>个目录项</span><br><span class="line"><span class="number">00009430</span>  d4 <span class="number">03</span> <span class="number">09</span> <span class="number">01</span> <span class="number">68</span> <span class="number">65</span> <span class="number">6</span>c <span class="number">6</span>c  <span class="number">6f</span> <span class="number">2</span>e <span class="number">74</span> <span class="number">78</span> <span class="number">74</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |....hello.txt...|</span><br><span class="line">          ^___^ ^^ ^^ ^__________________________________^</span><br><span class="line">                      ^名字hello.txt</span><br><span class="line"><span class="number">00009440</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th align="center">inode号</th>
<th align="center">目录项长度</th>
<th align="center">文件名长度</th>
<th align="center">文件类型</th>
<th align="center">文件名</th>
</tr>
</thead>
<tbody><tr>
<td align="center">0x02</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">.</td>
</tr>
<tr>
<td align="center">0x02</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">..</td>
</tr>
<tr>
<td align="center">0x0b</td>
<td align="center">0x14: 20 Bytes</td>
<td align="center">0x0a: 10</td>
<td align="center">目录</td>
<td align="center">lost+found</td>
</tr>
<tr>
<td align="center">0x0c</td>
<td align="center">0x3d4 Bytes</td>
<td align="center">0x09</td>
<td align="center">普通文件</td>
<td align="center">hello.txt</td>
</tr>
</tbody></table>
<p>这是根目录下的目录项，注意到第1个和第2个目录项的inode号都是0x02号inode，指向根目录自己（打开当前目录和打开上一级目录都是指向自己）。此外hello.txt的inode号为0x0c，因此hello.txt的inode的地址为0x1400+0x80$\times$(0x0c-1)&#x3D;0x1980，在此处查看hello.txt的inode信息。</p>
<h3 id="hello-txt的inode"><a href="#hello-txt的inode" class="headerlink" title="hello.txt的inode"></a>hello.txt的inode</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为hello.txt的i节点（12号）</span></span><br><span class="line"><span class="number">00001980</span>  a4 <span class="number">81</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">56</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e  |........VJ.^FJ.^|</span><br><span class="line"><span class="number">00001990</span>  <span class="number">46</span> <span class="number">4</span>a <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |FJ.^............|</span><br><span class="line"><span class="number">000019</span>a0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">01</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">01</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">                                   ^_________^</span><br><span class="line">                                     i_block:第一个数据块号</span><br><span class="line"><span class="number">000019b</span>0  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>hello.txt的inode信息说明第一个数据块的块号为0x0201，对应偏移是0x400$\times$0x201&#x3D;0x80400，查看该地址处的数据块的内容。</p>
<h3 id="hello-txt的数据块"><a href="#hello-txt的数据块" class="headerlink" title="hello.txt的数据块"></a>hello.txt的数据块</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为hello.txt的第一个数据块</span></span><br><span class="line"><span class="number">00080400</span>  <span class="number">48</span> <span class="number">65</span> <span class="number">6</span>c <span class="number">6</span>c <span class="number">6f</span> <span class="number">2</span>c <span class="number">20</span> <span class="number">77</span>  <span class="number">6f</span> <span class="number">72</span> <span class="number">6</span>c <span class="number">64</span> <span class="number">21</span> <span class="number">0</span>a <span class="number">00</span> <span class="number">00</span>  |Hello, world!...|</span><br><span class="line"><span class="number">00080410</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>数据块中存储着hello.txt的ASCII码。</p>
<h3 id="lost-found的inode"><a href="#lost-found的inode" class="headerlink" title="lost+found的inode"></a>lost+found的inode</h3><p>根目录中lost+found目录的inode编号为0x0b，因此lost+found目录文件的inode地址为0x1400+0x80$\times$(0x0b-1)&#x3D;0x1900，在此处查看lost+found的inode信息。</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为lost+found的inode</span></span><br><span class="line"><span class="number">00001900</span>  ed <span class="number">41</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">30</span> <span class="number">00</span> <span class="number">00</span>  d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e  |.A..<span class="number">.0</span>...I.^.I.^|</span><br><span class="line"><span class="number">00001910</span>  d7 <span class="number">49</span> <span class="number">9</span>e <span class="number">5</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">18</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |.I.^............|</span><br><span class="line"><span class="number">00001920</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">26</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">27</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |........&amp;..<span class="number">.&#x27;</span>...|</span><br><span class="line">                                   ^_________^ ^_________^</span><br><span class="line">                                     i_block     i_block</span><br><span class="line">                                 第一个数据块标号  第二个数据块标号</span><br><span class="line"><span class="number">00001930</span>  <span class="number">28</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">29</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">2</span>a <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |(...)...*...+...|</span><br><span class="line"><span class="number">00001940</span>  <span class="number">2</span>c <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2</span>d <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">2f</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |,...-......./...|</span><br><span class="line"><span class="number">00001950</span>  <span class="number">30</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">31</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |<span class="number">0.</span>.<span class="number">.1</span>...........|</span><br><span class="line"><span class="number">00001960</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<p>lost+found第一个数据块的块号为0x0026，对应偏移是0x400$\times$0x26&#x3D;0x9800，查看该地址处的数据块的内容。</p>
<h3 id="lost-found数据块内容"><a href="#lost-found数据块内容" class="headerlink" title="lost+found数据块内容"></a>lost+found数据块内容</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//以下为lost+found的目录项数据块</span></span><br><span class="line"><span class="number">00009800</span>  <span class="number">0b</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">0</span>c <span class="number">00</span> <span class="number">01</span> <span class="number">02</span>  <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">02</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^_________^ ^___^ ^^ ^^  ^_________^ ^_________^</span><br><span class="line">          inode       rec_len      name         inode</span><br><span class="line">                            ^name_len </span><br><span class="line">                               ^file_type      ^第<span class="number">2</span>个目录项</span><br><span class="line"><span class="number">00009810</span>  f4 <span class="number">03</span> <span class="number">02</span> <span class="number">02</span> <span class="number">2</span>e <span class="number">2</span>e <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">          ^___^ ^^ ^^ ^_________^</span><br><span class="line"><span class="number">00009820</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br><span class="line"><span class="number">00009</span>c00  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">04</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line"><span class="number">00009</span>c10  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span> <span class="number">00</span>  |................|</span><br><span class="line">***</span><br></pre></td></tr></table></figure>
<table>
<thead>
<tr>
<th align="center">inode号</th>
<th align="center">目录项长度</th>
<th align="center">文件名长度</th>
<th align="center">文件类型</th>
<th align="center">文件名</th>
</tr>
</thead>
<tbody><tr>
<td align="center">0x0b</td>
<td align="center">0x0c: 12 Bytes</td>
<td align="center">0x1</td>
<td align="center">目录</td>
<td align="center">.</td>
</tr>
<tr>
<td align="center">0x02</td>
<td align="center">0x03f4Bytes</td>
<td align="center">0x2</td>
<td align="center">目录</td>
<td align="center">..</td>
</tr>
<tr>
<td align="center">当前目录inode指向自己，而上一级目录指向根目录。</td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
</tbody></table>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://chudod.gitee.io/myworks/2022/05/18/OS_FileSystem/" data-id="cl3kznr05000oj0ukhacvegql" data-title="文件系统概念和Ext2文件系统" class="article-share-link">Share</a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/myworks/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" rel="tag">操作系统</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/myworks/2022/05/24/Russian_Grammar/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Русская Граммаатика(俄语语法)
        
      </div>
    </a>
  
  
    <a href="/myworks/2022/05/14/English_Sentences/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">English Sentences</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/English/">English</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F/">Россия</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%AF%BC%E8%88%AA/">导航</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/">并行计算</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/In-Network-Collectives/">In-Network Collectives</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/MPI%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1/">MPI程序设计</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/MPI%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%B9%B6%E8%A1%8C%E7%AE%97%E6%B3%95/">MPI程序设计与并行算法</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/MPI%E8%BD%AF%E4%BB%B6%E6%A0%88%E8%AE%BE%E8%AE%A1/">MPI软件栈设计</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/MPI%E9%9B%86%E5%90%88%E9%80%9A%E4%BF%A1%E7%AE%97%E6%B3%95/">MPI集合通信算法</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/Topology-Aware-Algorithms/">Topology-Aware Algorithms</a></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E6%95%B4%E6%B4%BB%E7%B3%BB%E5%88%97/">整活系列</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E7%A1%AC%E6%A0%B8%E7%8B%A0%E4%BA%BA/">硬核狠人</a></li><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/">计算机基础知识</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/myworks/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a></li></ul></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/English-Vocabulary/" rel="tag">English Vocabulary</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/English-Writing/" rel="tag">English Writing</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/MPI/" rel="tag">MPI</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/Topology-Aware/" rel="tag">Topology-Aware</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F/" rel="tag">Россия</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E5%9C%A8%E7%BD%91%E8%AE%A1%E7%AE%97/" rel="tag">在网计算</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E5%B9%B6%E8%A1%8C%E7%AE%97%E6%B3%95/" rel="tag">并行算法</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/" rel="tag">并行计算</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" rel="tag">操作系统</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E6%95%B4%E6%B4%BB/" rel="tag">整活</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E7%94%9F%E6%B4%BB/" rel="tag">生活</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E7%A1%AC%E6%A0%B8%E7%8B%A0%E4%BA%BA/" rel="tag">硬核狠人</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E9%9B%86%E5%90%88%E9%80%9A%E4%BF%A1/" rel="tag">集合通信</a></li><li class="tag-list-item"><a class="tag-list-link" href="/myworks/tags/%E9%AB%98%E6%80%A7%E8%83%BD%E8%AE%A1%E7%AE%97/" rel="tag">高性能计算</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/myworks/tags/English-Vocabulary/" style="font-size: 10px;">English Vocabulary</a> <a href="/myworks/tags/English-Writing/" style="font-size: 10px;">English Writing</a> <a href="/myworks/tags/MPI/" style="font-size: 17.5px;">MPI</a> <a href="/myworks/tags/Topology-Aware/" style="font-size: 10px;">Topology-Aware</a> <a href="/myworks/tags/%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D1%8F/" style="font-size: 12.5px;">Россия</a> <a href="/myworks/tags/%E5%9C%A8%E7%BD%91%E8%AE%A1%E7%AE%97/" style="font-size: 12.5px;">在网计算</a> <a href="/myworks/tags/%E5%B9%B6%E8%A1%8C%E7%AE%97%E6%B3%95/" style="font-size: 10px;">并行算法</a> <a href="/myworks/tags/%E5%B9%B6%E8%A1%8C%E8%AE%A1%E7%AE%97/" style="font-size: 20px;">并行计算</a> <a href="/myworks/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" style="font-size: 15px;">操作系统</a> <a href="/myworks/tags/%E6%95%B4%E6%B4%BB/" style="font-size: 10px;">整活</a> <a href="/myworks/tags/%E7%94%9F%E6%B4%BB/" style="font-size: 10px;">生活</a> <a href="/myworks/tags/%E7%A1%AC%E6%A0%B8%E7%8B%A0%E4%BA%BA/" style="font-size: 10px;">硬核狠人</a> <a href="/myworks/tags/%E9%9B%86%E5%90%88%E9%80%9A%E4%BF%A1/" style="font-size: 15px;">集合通信</a> <a href="/myworks/tags/%E9%AB%98%E6%80%A7%E8%83%BD%E8%AE%A1%E7%AE%97/" style="font-size: 12.5px;">高性能计算</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/myworks/archives/2022/05/">May 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/myworks/archives/2022/04/">April 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/myworks/archives/2022/03/">March 2022</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/myworks/2022/05/24/Russian_Grammar/">Русская Граммаатика(俄语语法)</a>
          </li>
        
          <li>
            <a href="/myworks/2022/05/18/OS_FileSystem/">文件系统概念和Ext2文件系统</a>
          </li>
        
          <li>
            <a href="/myworks/2022/05/14/English_Sentences/">English Sentences</a>
          </li>
        
          <li>
            <a href="/myworks/2022/05/11/English_Vocabulary/">English Vocabulary</a>
          </li>
        
          <li>
            <a href="/myworks/2022/05/11/Russian_Vocabulary/">Русские Слова(俄语单词)</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2022 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/myworks/" class="mobile-nav-link">Home</a>
  
    <a href="/myworks/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/myworks/js/jquery-3.4.1.min.js"></script>



  
<script src="/myworks/fancybox/jquery.fancybox.min.js"></script>




<script src="/myworks/js/script.js"></script>





  </div>
</body>
</html>